const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    name:{type:String},
    avater:{type:String},
    title:{type:String},
    delay:{type:String},
    cost:{type:String},
    categories:[{type:mongoose.Schema.Types.ObjectId,ref:'Category'}],
    banner:{type:String},
    scores:{
        difficult:{type:Number}, 
        skills:{type:Number},
        attack:{type:Number},
        survive:{type:Number},
    },
    skills:{
        icon:{type:String}, 
        name:{type:String},
        description:{type:String},
        tips:{type:String},
    },
    item1:[{type:mongoose.Schema.Types.ObjectId,ref:'Item'}],
    item2:[{type:mongoose.Schema.Types.ObjectId,ref:'Item'}],
    usageTips:{type:String},
    battleTips:{type:String},
    teamTips:{type:String},
    partners:[{
        hero:{type:mongoose.Schema.Types.ObjectId,ref:'Hero'},
        description:{type:String},
    }]
})

module.exports = mongoose.model("Hero",schema,'heroes')